<template>
  <div class="">
    <el-dialog class="m_dialog" title="详情" :visible.sync="dialogVisible" width="800" append-to-body :before-close="cancel"
      :close-on-click-modal="false">
      <div class="content">
        <div class="content-box">
          <div class="box-heard">
            <CustomTitle title="基本信息"></CustomTitle>
          </div>
          <div class="box-body" style="min-height: 317px;">
            <BaseDescriptions :descConfig="descConfig" :descConfigItem="basisConfigItem" :descModel="descModel">
            </BaseDescriptions>
          </div>
        </div>
        <div class="content-box">
          <div class="box-heard">
            <CustomTitle title="整改信息"></CustomTitle>
          </div>
          <div class="box-body" style="min-height: 317px;">
            <BaseDescriptions :descConfig="descConfig" :descConfigItem="rectificationConfigItem" :descModel="descModel">
            </BaseDescriptions>
          </div>
        </div>
        <div class="content-box">
          <div class="box-heard">
            <CustomTitle title="验收结果"></CustomTitle>
          </div>
          <div class="box-body" style="min-height: 317px;">
            <BaseDescriptions :descConfig="descConfig" :descConfigItem="acceptanceConfigItem" :descModel="descModel">
            </BaseDescriptions>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
  
<script>
import { mapState } from 'vuex';
import BaseDescriptions from '@/components/PageContent/BaseDescriptions.vue';
export default {
  name: 'operationDetail',
  props: {
    dialogVisible: {
      type: Boolean,
      default: false,
    },
    //   titleIndex: {
    //     type: Number | String,
    //     default: 0,
    //   },
    //   descData: {
    //     type: Object,
    //     default: () => {},
    //   },
    //   dictMap: {
    //     type: Object,
    //     default: () => {},
    //   },
  },
  data() {
    return {
      descConfig: {
        size: 'medium',
        column: '2',
      },
      descModel: {
        infoId: '',
        userName: '',
        ipaddr: '',
        status: '',
        accessTime: '',
      },
      //整改信息配置
      rectificationConfigItem: [
        {
          fieIdName: 'infoId',
          label: '处理人员',
          span: 2,
        },
        {
          fieIdName: 'userName',
          label: '处理时间',
          span: 2,
        },
        {
          fieIdName: 'ipaddr',
          label: '隐患类型',
          span: 2,
        },
        {
          fieIdName: 'status',
          label: '整改内容',
          span: 2,
          slotName: 'status',
        },
        {
          fieIdName: 'accessTime',
          label: '整改图片',
          span: 2,
          component: 'BaseImages',
        },
      ],
      // 基础信息配置
      basisConfigItem: [
      {
          fieIdName: 'infoId',
          label: '隐患事项',
          span: 2,
        },
        {
          fieIdName: 'userName',
          label: '所属项目点位',
          span: 2,
        },
        {
          fieIdName: 'ipaddr',
          label: '发现人员',
          span: 2,
        },
        {
          fieIdName: 'status',
          label: '发现时间',
          span: 2,
          slotName: 'status',
        },
        {
          fieIdName: 'msg',
          label: '隐患内容',
          span: 2,
        },
        {
          fieIdName: 'accessTime',
          label: '隐患图片',
          component: 'BaseImages',
          span: 2,
        },
      ],
      // 验收结果配置
      acceptanceConfigItem: [
        {
          fieIdName: 'infoId',
          label: '验收人员',
          span: 2,
        },
        {
          fieIdName: 'userName',
          label: '验收时间',
          span: 2,
        },
        {
          fieIdName: 'ipaddr',
          label: '验收备注',
          span: 2,
        },
      ],
    };
  },
  computed: {
    ...mapState('dialog', ['dialogTitles']),
  },
  watch: {
    // descData: {
    //   deep: true,
    //   immediate: true,
    //   handler() {
    //     this.descModel = JSON.parse(JSON.stringify(this.descData));
    //   },
    // },
  },
  created() { },
  mounted() { },
  methods: {
    cancel() {
      this.$emit('cancel');
    },
  },
  components: {
    BaseDescriptions,
  },
};
</script>
  
<style lang="less" scoped></style>
  